package com.springboot.film.service;

import com.springboot.film.entity.looktime;
import com.springboot.film.dao.looktimeDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class looktimeService {

    @Autowired
    private looktimeDao looktimeDao;

    /**
     * 显示总数量
     * @return
     */
    public int getCount() {
        return looktimeDao.getCount();
    }

    /**
     * 全部分页显示
     * @return
     */
    public List<looktime> findByPage(int pos, int size) {
        return looktimeDao.findByPage(pos, size);
    }

    /**
     * 显示搜索的总数量
     * @return
     */
    public int getsearchCount(String key,String name) {
        return looktimeDao.getsearchCount(key,name);
    }

    /**
     * 搜索并分页显示
     * @return
     */
    public List<looktime> findsearchByPage(String key,String name,int pos, int size) {
        return looktimeDao.findsearchByPage(key,name,pos, size);
    }

    /**
     * 添加
     * @param
     */
    public void houtaiadd(looktime looktime) {
        looktimeDao.houtaiadd(looktime);
    }
    public void add(int uid,int fid,int time_temp) {
        looktimeDao.add(uid,fid,time_temp);
    }

    /**
     * 删除
     * @param id
     */
    public void delete(int id) {
        looktimeDao.delete(id);
    }

    /**
     * 修改(先找到并显示，再修改)
     * @param
     */
    public List<looktime> getUserone(int id) {
        return looktimeDao.getUserone(id);
    }
    public void update(looktime looktime) {
        looktimeDao.update(looktime);
    }

    public int getmaxtime(int uid,int fid) {
        return looktimeDao.getmaxtime(uid,fid);
    }

    public int getcountid(int uid,int fid) {
        return looktimeDao.getcountid(uid,fid);
    }
    public int getmaxid(int uid,int fid) {
        return looktimeDao.getmaxid(uid,fid);
    }
    public void updatelooktime(int time_temp,int id) {
        looktimeDao.updatelooktime(time_temp,id);
    }

}
